package gdata;

import com.google.gdata.client.calendar.CalendarService;
import com.google.gdata.client.docs.DocsService;
import config.EncryptedProperties;

/**
 * Class description...
 *
 * @author mvu
 */
public class GUtil {
  public static CalendarService getCalendarService() throws Exception {
    CalendarService myService = new CalendarService("bluesync");
    EncryptedProperties properties = EncryptedProperties.getDefaultInstance();
    String username = properties.getUsername();
    String password = properties.getPassword();
    myService.setUserCredentials(username, password);
    return myService;
  }

  public static DocsService getDocsService() throws Exception {
    DocsService myService = new DocsService("bluesync");
    EncryptedProperties properties = EncryptedProperties.getDefaultInstance();
    String username = properties.getUsername();
    String password = properties.getPassword();
    myService.setUserCredentials(username, password);
    return myService;

  }

}
